/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 attackable_obstacle.h

	$Header: /heroes4/attackable_obstacle.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ATTACKABLE_OBSTACLE_H_INCLUDED )
#define ATTACKABLE_OBSTACLE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "attackable_object.h"
#include "compound_object.h"

// -----------------------------------------------------------------------
// stationary combat object which can be attacked
// -----------------------------------------------------------------------
class t_attackable_obstacle : public t_attackable_object, public t_compound_object
{
public:
	t_attackable_obstacle();
	t_attackable_obstacle( t_combat_object_model_cache const& cache, int hits );

	virtual void							apply_damage( t_battlefield& battlefield, 
														  bool show_death );
	void									fade_in( t_battlefield& battlefield, int alpha, t_combat_action_message const & message );
	virtual t_abstract_combat_object const*	get_const_object() const;
	virtual float							get_defense_basic( bool ranged ) const;
	virtual float							get_defense_bonus( bool ranged ) const;
	virtual std::string						get_object_name() const;
	virtual t_combat_object_list			get_objects() const;
	virtual int								get_total_hits(bool include_guardian_angel = false,
															t_spell ignore_effect = k_spell_none) const;
	virtual bool							is_alive() const;
	virtual void							place( t_battlefield& battlefield,
												   t_map_point_2d const& point );
	virtual bool							read( t_combat_reader& reader );
	virtual void							remove( t_battlefield& battlefield );
	virtual bool							write( t_combat_writer& writer ) const;
protected:
	t_stationary_combat_object* m_center_segment;
	int							m_hit_points;
};

inline t_attackable_obstacle::t_attackable_obstacle()
{
	m_center_segment = 0;
	m_hit_points = 0;
}


#endif // ATTACKABLE_OBSTACLE_H_INCLUDED